package demo2;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-09-15
 * Time:9:50
 */
class B {
    public B() {
        fun();
    }
    public void fun(){
        System.out.println("父类的fun");
    }

}
class C extends B{
    private int x=30;
    @Override
    public void fun() {
        System.out.println("子类的fun中"+"x的值等于"+x);
    }
}
public class A {
    public static void main(String[] args) {
        C c=new C();
    }
}